package com.jxpanda.infrastructure.crypto.key;

import com.jxpanda.infrastructure.crypto.constant.AlgorithmEncrypt;
import com.jxpanda.infrastructure.crypto.key.contract.AbstractKeyProvider;
import com.jxpanda.infrastructure.crypto.key.contract.SecretKeyProvider;
import com.jxpanda.infrastructure.crypto.model.SecretKeyGenParameterSpec;

import javax.crypto.SecretKey;

public class AesKeyProvider extends AbstractKeyProvider<SecretKey, SecretKeyGenParameterSpec> implements SecretKeyProvider {

    public AesKeyProvider() {
        super(AlgorithmEncrypt.AES.KEY_ALGORITHM);
    }

    @Override
    public SecretKey generateKey() {
        return generateKey(new SecretKeyGenParameterSpec(AlgorithmEncrypt.AES.KEY_LENGTH));
    }
}
